<!DOCTYPE html>
<html lang="zh-CN"><head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>充值记录 - {php echo $this->module['config']['sname']}</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
	<meta content="telephone=no" name="format-detection">
    <link href="{WELIAM_INDIANA_STATIC}css/common.css" rel="stylesheet">
    <link href="{WELIAM_INDIANA_STATIC}css/user.css" rel="stylesheet">
    <script language="javascript" src="{WELIAM_INDIANA_STATIC}js/jquery.js"></script>
    {template wxshare}
</head>
<script>
	//自动刷新
	var id={$id};
	var flag=0;
		//检测没有数据
		
	function refresh(){
		var re = document.getElementById('more');
		if({$id} == -1){
			re.innerHTML='没有更多的信息了';
		}
	}
	//判断div是否在可视区域
	  $(document).ready(function () {
            $(window).scroll(function () {
                var a = document.getElementById("more").offsetTop;
                if (a >= $(window).scrollTop() && a < ($(window).scrollTop()+$(window).height())&&id!='-1'&&flag=='0') {
                   document.getElementById('more').innerHTML="努力加载中";
					flag = 1;
					down_load();	
                }
            });
        });
//回传数据
	
	function down_load(){
		//传值验证返回	
	    $.post("{php echo $this->createMobileUrl('recharge_records')}",
	    {
	    	id:id
	    },
	    function(m){
				if(m==''){
					document.getElementById('more').innerHTML="没有可加载项";
				}else{
					if(m.success=='-1'){
						document.getElementById('more').innerHTML='没有更多的信息了';
					}else{
						
						id = m.success;
						for(var i=0;i<m.list.length;i++){
							if(m.list[i].paytype==3){
								m.list[i].paytype = '微信支付';
							}else if(m.list[i].paytype==2){
								m.list[i].paytype = '支付宝支付';
							}else if(m.list[i].paytype==4){
								m.list[i].paytype = '京东支付';
							}else if(m.list[i].paytype==5){
								m.list[i].paytype = '百度钱包支付';
							}else if(m.list[i].paytype==-1){
								m.list[i].paytype = '关注后系统赠送';
							}else if(m.list[i].paytype==0){
								m.list[i].paytype = '微信云支付';
							}
							var more = '<div class="item" id="pro-view-4"><p class="from">'+m.list[i].paytype+'</p><p class="time">时间:'+m.list[i].createtime+'</p><p class="num">￥ '+m.list[i].num+'</p></div>';
							$("#morelist").append(more);
							flag = 0;
							document.getElementById('more').innerHTML="上拉加载更多";
						}
						
					}
				}

             },"json");
	}
	
</script>
<body onload="refresh();">
<div class="m-user">
    <div class="m-simpleHeader" id="dvHeader">
        <a href="{php echo $this->createMobileUrl("person");}" data-pro="back" data-back="true" class="m-simpleHeader-back"><i class="ico ico-back"></i></a>
        <a href="{php echo $this->createMobileUrl("recharge");}" data-pro="ok" class="m-simpleHeader-ok">充值</a>
        <h1>充值记录</h1>
    </div>
    <div class="m-user-chargeRecord">
        <div class="remark">
            <p class="item">目前仅提供最近三个月的充值记录。</p>
        </div>
        
        <div id="dvWrapper">
            <!--最近三个月有充值记录-->
            <div id="have-more">
                <div data-pro="loading"></div>
                <!-- 充值记录 -->
                
                <div class="list" id="morelist">
                	{loop $result $result}
                    <div class="item" id="pro-view-4">
                		<p class="from">{if $result['paytype']==2}支付宝支付{elseif $result['paytype']==3}微信支付{elseif $result['paytype']==4}京东支付{elseif $result['paytype']==5}百度钱包支付{elseif $result['paytype']==-1}关注后系统赠送{elseif $result['paytype'] == 0}微信云支付{/if}</p>
                		<p class="time">时间:{php echo date("Y-m-d H:i:s",$result['createtime'])}</p>
               			<p class="num">￥ {$result['num']}</p>
                    </div>
                    {/loop}
                </div>
				
 		<div data-pro="more">
        	<div class="w-more" id="pro-view-5">
            	<div data-pro="link" id = "more">上拉加载更多</div>
        	</div>
        </div>
        </div>
    </div>
    </div>
</div>